/*
 * @Author: t-xiangqun.li t-xiangqun.li@pcitc.com
 * @Date: 2025-10-16 11:15:35
 * @LastEditors: lixiangqun
 * @LastEditTime: 2025-11-14 17:33:21
 * @FilePath: \electrconVue\src\types.ts
 * @Description: ts定义
 */
export interface ConversationProps {
  id: number;
  title: string;
  selectedModel: string;
  createdAt: string;
  updatedAt: string;
  providerId: number;
}

export interface ProviderProps {
  id: number;
  name: string;
  title?: string;
  desc?: string;
  avatar?: string;
  createdAt: string;
  updatedAt: string;
  models: string[];
}

export type MessageStatus = "loading" | "streaming" | "finished";

export interface MessageProps {
  id: number;
  content: string;
  type: "question" | "answer";
  status?: MessageStatus;
  conversationId: number;
  createdAt: string;
  updatedAt: string;
  imagePath?: string;
}

export type MessageRole = "user" | "assistant";

export interface SendMessageProps {
  role: string;
  content: string;
  imagePath?: string;
}

export interface CreateChatProps {
  // content: string;
  messages: { role: string; content: string; imagePath?: string }[];
  messageId: number;
  selectedModel: string;
  providerName: string;
}

export interface UpdatedStreamData {
  messageId: number;
  data: {
    is_end?: boolean;
    result: string;
  };
}

export type OnUpdatedCallback = (data: UpdatedStreamData) => void;

export interface MessageListProps {
  ref: HTMLDivElement;
}

export interface UniversalChunkProps {
  is_end: boolean;
  result: string;
}
